//---------------------------------------------------------------------------------
#include <CTestMapReader.h>
//---------------------------------------------------------------------------------
void CTestMapReader::initTestCase(void) {
	map=new CMap();
}
//---------------------------------------------------------------------------------
void CTestMapReader::createMapTest(void) {
	QString level="    ####\n  ## @##\n\n\n\n\rT ";
	int w, h;
	int xP, yP;
	
	CMapReader::createMap(map, level);
	QCOMPARE(16, map->getNbCase());
	QCOMPARE(CCase::ectVide, map->getCase(0, 0)->getCaseType());
	QCOMPARE(CCase::ectMur, map->getCase(4, 0)->getCaseType());
	QCOMPARE(CCase::ectVide, map->getCase(0, 1)->getCaseType());
	QCOMPARE(CCase::ectMur, map->getCase(2, 1)->getCaseType());
	map->getSize(w, h);
	QCOMPARE(w, 8);
	QCOMPARE(h, 2);
	map->getPlayerPos(xP, yP);
	QCOMPARE(xP, 5);
	QCOMPARE(yP, 1);
}
//---------------------------------------------------------------------------------
void CTestMapReader::cleanupTestCase(void) {
	delete map;
}
//---------------------------------------------------------------------------------